<div class="popw" style="display: -webkit-box;">
    <div class="popwbg"></div>
    <div class="popwbox taobox popwboxshow">
        <div class="taologo">
            <img src="{{goods.pictUrl}}"
                 style="border-radius:50%">
        </div>
        <div class="taocon">
            <div class="taotitle">
                <div class="popwcontent" id="taocontent">
                    <div style="text-align: left;">
                        <span id="code1_ios" class="kl-tkl" style="display: inline;">{{{iosText}}}</span>
                    </div>
                    <textarea id="copybox" class="copybox"
                              style="display: block; text-align: left; border: 0px; min-height: 160px;">{{{text}}}</textarea>
                </div>
            </div>
        </div>
        <div class="taokaobox">
            <a id="copybtn" href="javascript:;" class="weui_btn weui_btn_warn weui_btn_mini"
               style="display: block; margin-bottom: 15px;" data-clipboard-action="copy"
               data-clipboard-target="#copybox">一键复制</a>
        </div>
    </div>
</div>
<script>
    document.addEventListener("selectionchange", function (e) {
        var selection = window.getSelection();
        if (selection && selection.anchorNode && selection.anchorNode.parentNode) {
            var key = document.getElementById('code1_ios');
            if (selection.anchorNode.parentNode.id == 'code1_ios' && key.innerText != window.getSelection()) {
                selection.selectAllChildren(key);
            }
        }
    }, false);

    //判断是安卓还是苹果
    function isIOS() {
        var ua = navigator.userAgent.toLowerCase();
        if (/iphone|ipad|ipod/.test(ua)) {
            return true;
        } else if (/android/.test(ua)) {
            return false;
        }
    }

    //判断安卓苹果显示
    if (isIOS()) {
        $("#copybox").hide();
        $("#code1_ios").show();
    } else {
        $("#code1_ios").hide();
        $("#copybox").show();
    }
</script>